package com.example.rtsp_model_xml;

import android.net.Uri;
import android.os.Bundle;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;

import com.alexvas.rtsp.widget.RtspSurfaceView;

public class MainActivity extends AppCompatActivity {
    private RtspSurfaceView svVideo;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        svVideo = findViewById(R.id.svVideo);
        Uri uri = Uri.parse("rtsp://admin:123456@192.168.1.123/stream1");
        svVideo.init(uri, "admin", "123456", "");
        svVideo.start(
                true,
                true,
                false
        );
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        svVideo.stop();
        svVideo.setStatusListener(null);
    }
}